﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using KWindow;
using KInterfaces;
using System.Diagnostics;

namespace KWindow.KPageCore
{
    public partial class FormAdministrator : Form
    {
       
        private AdministratorAction _selectAction = AdministratorAction.None;
        public AdministratorAction SelectAction
        {
            get { return _selectAction; }
        }

        public FormAdministrator()
        {
            InitializeComponent();
        }

        private void buttonClose_Click(object sender, EventArgs e)
        {
            _selectAction = AdministratorAction.None;
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.Close();
        }

        private void buttonAbout_Click(object sender, EventArgs e)
        {
            _selectAction = AdministratorAction.About;
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }

        private void buttonSettings_Click(object sender, EventArgs e)
        {
            _selectAction = AdministratorAction.Setting;
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }

        private void buttonExit_Click(object sender, EventArgs e)
        {
            _selectAction = AdministratorAction.Exit;
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();

        }

        private void buttonLockSys_Click(object sender, EventArgs e)
        {
            _selectAction = AdministratorAction.Lock;
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }

        private void buttonReboot_Click(object sender, EventArgs e)
        {
            _selectAction = AdministratorAction.Reboot;
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }

        private void buttonShutDown_Click(object sender, EventArgs e)
        {
            _selectAction = AdministratorAction.Shutdown;
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }

        private Point mouse_offset;
        private void panel1_MouseDown(object sender, MouseEventArgs e)
        {
            mouse_offset = new Point(-e.X, -e.Y);
        }

        private void panel1_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                Point mousePos = Control.MousePosition;
                mousePos.Offset(mouse_offset.X, mouse_offset.Y);
                Location = mousePos;
            }
        }
    }
}
